/**
 * 
 */
package combat;

import java.util.*;
import java.awt.*;

/**
 * @author Stefano Sansone
 * Provide implementation for one round of a game.
 *
 */
public class Round {

	private Game game;
	Board theBoard;
	
	/**
     * Play with new "lives" for each player.
     */
    public Round(Game game)
    {
    	this.game = game;
    	
        if( game.level != null ) game.level.cleanUp();
        game.pause();
        game.timer.removeAll();
        Rectangle tmp = game.getBounds();
        game.getGraphics().clearRect( tmp.x, tmp.y, tmp.width, tmp.height );
        game.repaint();
        game.level = new LevelBuilder( game.levelFile, game, game.ci );
        LinkedList<Timed> objects = game.level.getTimed();
        ListIterator<Timed> iterator = objects.listIterator(0);
        while( iterator.hasNext() )
        {
        	game.timer.addTimed( (Timed)iterator.next() );
        }
        game.gameActive = true;
        game.resume();
    }
    
}
